#ifndef VIDEOPLAYER_H
#define VIDEOPLAYER_H

#include <QWidget>
#include <QFileDialog>
#include <QCoreApplication>
#include <QStackedWidget>
#include <QApplication>
#include <QMediaPlayer>
#include <QVideoWidget>
#include <qaudiooutput>
#include <QAudio>
#include <QAudioDevice>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QPushButton>
#include <TcpServer.h>
#include <QSlider>
#include <QStyle>
#include <QLabel>
#include <QTime>

//local
#include <transparentoverlay.h>
#include <mainwindow.h>

class VideoPlayer : public QWidget
{
    Q_OBJECT
public:
    explicit VideoPlayer(QWidget *parent = nullptr);
    ~VideoPlayer();

    void KeyTriggerSystem();

private slots:

    void onESCPressed();

private:
    QVideoWidget *videoWidget;
    QAudioOutput *audiooutput;
    QMediaPlayer *player;
    QLabel *imageLabel;

    QStackedWidget *stackedWidget;

    TransparentOverlay *m_transparentOverlay;

public:
    // 记录是否正在播放
    bool isPlaying;
    // 记录是否正在拖动滑块
    bool isSliderDragging;
    QString getTime(qint64 time);

    //播放列表index
    int currentFileIndex;
    //播放列表
    QStringList videoFiles;
};


#endif // VIDEOPLAYER_H
